﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using Model;
using System.Data.SqlClient;
using System.IO;
using HT.DAL;

namespace BLL
{
    public class BasicBLL
    {
        private readonly Dal_Basic dal = new Dal_Basic();
        #region 打印机管理 基本信息设置
        public int AddPrintList(string name, int num, int type)
        {
            return dal.AddPrintList(name,   num,   type);
        }
        public bool isExistPrint(string name)
        {
            return dal.isExistPrint(name );
        }
        public int UpdatePrintList(string name, int num, int type)
        {
            return dal.UpdatePrintList(name,   num,   type);
        }
        public int DeletePrintList(string name)
        {
            return dal.DeletePrintList(name );
        }
        public DataTable GetPrintList()
        {
            return dal.GetPrintList( );
        }
        #endregion

        public DataTable GetData(string tablename, string strWhere)
        {
            return dal.GetData(tablename,   strWhere);
        }

        public DataTable GetData(string tablename, string strWhere, string fileds)
        {
            return dal.GetData(tablename,   strWhere,   fileds);
        }

        public DataTable GetData(string sql)
        {
            return dal.GetData(sql);
        }

        /// <summary>
        /// 从 条件表中获取信息
        /// </summary>
        /// <param name="content">查询内容</param>
        /// <param name="tableName">表名</param>
        /// <param name="condition">条件(含 where 部分)</param>
        /// <returns></returns>
        public string GetDataByFiled(string content, string tableName, string condition)
        {
            return dal.GetDataByFiled(content,   tableName,   condition);
        }

        public string GetObjData(string sql)
        {
            return dal.GetObjData(sql);
        }

        public DataTable GetpfdHData(int pageSize, int pageIndex, ref int count)
        {
            return dal.GetpfdHData(pageSize,   pageIndex, ref   count);
        }
        public int GetpfdHCount(string strWhere)
        {
            return dal.GetpfdHCount(strWhere);
        }
        /// <summary>
        /// 得到一个对象实体(xskdh)
        /// </summary>
        /// <returns></returns>
        public xskdh GetXskdhModel(string xsdh)
        {
            return dal.GetXskdhModel(xsdh);
        }


        /// <summary> 
  		/// 将数据集(DataTable)转换 对象 xskdh_Entity
  		/// 创建人：minjie 
  		/// 创建时间:2018-06-28 10:45:35 
  		/// </summary> 
  		public xskdh GetXskdhEntity(DataRow dr)
        {
            return dal.GetXskdhEntity(dr);
        }


        public DataSet GetxskdBDataDs(string strWhere)
        {
            return dal.GetxskdBDataDs(strWhere);
        }
        /// <summary>
        /// 修改状态
        /// </summary>
        /// <returns></returns>
        public int UpdatexskdhStatus(DataTable dt)
        {
            return dal.UpdatexskdhStatus(dt);
        }
        /// <summary>
        /// 保存销售单
        /// </summary>
        /// <param name="sqlList"></param>
        /// <returns></returns>
        public int UpdateXskdData(List<string> sqlList)
        {
            return dal.UpdateXskdData(sqlList);
        }
        public SpdaHModel GetspdaHModel(DataRow dr)
        {
            return dal.GetspdaHModel(dr);
        }

        /// <summary>
        /// 是否存在
        /// </summary>
        /// <param name="spbh"></param>
        /// <returns></returns>
        public bool IsExistSpbh(string spbh)
        {
            return dal.IsExistSpbh(spbh);
        }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Updatejbxx_yyydaHModel(yyydaHModel model)
        {
            return dal.Updatejbxx_yyydaHModel(model);
        }

        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Addjbxx_yyydaHModel(yyydaHModel model)
        {
            return dal.Addjbxx_yyydaHModel(model);
        }

        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public HykblHModel GetkhdaHModel(DataRow dr)
        {
            return dal.GetkhdaHModel(dr);
        }

        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool UpdatespdaHModel(SpdaHModel model)
        {
            return dal.UpdatespdaHModel(model);
        }

        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool AddspdaHModel(SpdaHModel model)
        {
            return dal.AddspdaHModel(model);
        }

        /// <summary>
        ///营业员 得到一个对象实体
        /// </summary>
        public yyydaHModel GetyyydaHModel(DataRow dr)
        {
            return dal.GetyyydaHModel(dr);
        }

        /// <summary>
        /// 是否存在
        /// </summary>
        /// <param name="spbh"></param>
        /// <returns></returns>
        public bool IsExistYyy(string ygbh)
        {
            return dal.IsExistYyy(ygbh);
        }


        /// <summary>
        /// 是否存在 客户信息
        /// </summary>
        /// <param name="spbh"></param>
        /// <returns></returns>
        public bool IsExistKhxx(string khbh)
        {
            return dal.IsExistKhxx(khbh);
        }

        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool Updatejbxx_khdaH(HykblHModel model)
        {
            return dal.Updatejbxx_khdaH(model);
        }


        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool Addjbxx_khdaH(HykblHModel model)
        {
            return dal.Addjbxx_khdaH(model);
        }


        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public dmdaHModel GetdmdaHModel(DataRow dr)
        {
            return dal.GetdmdaHModel(dr);
        }
        public bool IsExistBmdaH(string bmdaH)
        {
            return dal.IsExistBmdaH(bmdaH);
        }

        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool AddbmdaH(bmdaHModel model)
        {
            return dal.AddbmdaH(model);
        }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool UpdatebmdaH(bmdaHModel model)
        {
            return dal.UpdatebmdaH(model);
        }


        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public bmdaHModel GetbmdaHModel(DataRow dr)
        {
            return dal.GetbmdaHModel(dr);
        }

        /// <summary>
        /// 是否存在 店面信息
        /// </summary>
        /// <param name="spbh"></param>
        /// <returns></returns>
        public bool IsExistDmxx(string dmbh)
        {
            return dal.IsExistDmxx(dmbh);
        }

        /// <summary>
        /// 增加一条数据
        /// </summary>
        public bool AdddmdaH(dmdaHModel model)
        {
            return dal.AdddmdaH(model);
        }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public bool UpdatedmdaH(dmdaHModel model)
        {
            return dal.UpdatedmdaH(model);
        }
    }
}
